International Math Olympiad Solution